Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate remote cache server for Bazel #21

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

p0deje
Copy link
Member

@p0deje p0deje commented May 30, 2024

Related to #18

This pull request introduces a significant enhancement to the setup-bazel action by implementing a remote cache server for Bazel build outputs, aiming to improve build performance and cache utilization.

  • Implements a remote cache server: Adds a new file remote-cache-server.js that creates an HTTP server compatible with Bazel's remote caching API. This server handles GET and PUT requests to store and retrieve cache objects, leveraging @actions/cache for underlying storage.
  • Integrates the remote cache server with the action: Modifies index.js to start the remote cache server as a detached process during the action's execution. The server's URL is then added to .bazelrc to enable Bazel to use it for caching.
  • Enhances configuration: Updates config.js to include settings for the remote cache server's URL and log file path, ensuring that these new features are configurable.
  • Ensures clean shutdown: Adjusts post.js to stop the remote cache server gracefully at the end of the action's execution and logs the server's output for debugging purposes.
  • Build script update: Modifies package.json to include the remote cache server in the build process, ensuring that all necessary components are compiled and ready for use.

For more details, open the Copilot Workspace session.

@chickenandpork
Copy link

Is the dist/main/ directory included by accident? Many files seem duplicate between . and dist/main/, for example, dist/main/remote-cache-server.js is in both paths.

@p0deje
Copy link
Member Author

p0deje commented Aug 10, 2024

@chickenandpork It's included intentionally, so I could test the branch in GHA directly. This however is not intended to be used directly as it's not really working stable. Are you interested in taking over and finishing this PR?

@chickenandpork
Copy link

@chickenandpork It's included intentionally, so I could test the branch in GHA directly. This however is not intended to be used directly as it's not really working stable.

OK, I understand; it looked like an error of duplicate code!

Are you interested in taking over and finishing this PR?

I don't think my javascript is sufficient. I only worked javascript (and coffeescript!) briefly around 2020. Sorry :(

Personally I use a local buchgr cache and I set up the same in ephemeral build clusters.

@p0deje p0deje added the help wanted Extra attention is needed label Aug 16, 2024
@JohnAmican
Copy link

@chickenandpork It's included intentionally, so I could test the branch in GHA directly. This however is not intended to be used directly as it's not really working stable. Are you interested in taking over and finishing this PR?

I'm interested in picking this up. What's not stable? What else is outstanding?

@p0deje
Copy link
Member Author

p0deje commented Aug 28, 2024

@JohnAmican The summary is in #18 (comment), the stability is the main issue as on large projects the REST API calls to the GHA cache get rate limited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants